<?php

namespace app\common\model;

use think\Request;

/**
 * 日志操作类
 * Class Category
 * @package app\common\model
 */
class Log extends BaseModel
{
    protected $name = 'log';
    protected $updateTime = false;

    /**
     * 获取列表
     * @return \think\Paginator
     * @throws \think\exception\DbException
     */
    public function getList()
    {
        return $this->order(['create_time' => 'desc'])
            ->paginate(15, false, [
                'query' => Request::instance()->request()
            ]);
    }

    /**
     * 日志详情
     * @param $log_id
     * @return null|static
     * @throws \think\exception\DbException
     */
    public static function detail($log_id)
    {
        return self::get($log_id);
    }
}
